<?php

/**
 * Base class for all plugins
 * Takes care of registering plugin, info about plugins.
 *
 * @version $Id$
 * @copyright 2010
 */

/**
 * Base class for all plugins
 * Takes care of registering plugin, info about plugins.
 */
class Plugin
{
	public $plugin_name = "Generic plugin";
	public $plugin_short_desc = "Generic plugin class";
	public $plugin_long_desc = "Hahaha, generic plugin class";
	public $version = "1.0";
	public $needs_install = false;

	/**
	 * Constructor
	 */
	function __construct()
	{

	}

	public function say_hello()
	{
		echo '<p>Hi, i am plugin <b>',$this->plugin_name,'</b> version <b>',$this->version,
			'</b>.<br /> My description is: ',$this->plugin_short_desc,'<br /> and i do this: ',$this->plugin_long_desc,'</p>';
	}

	private function generate_sidebar()
	{
		global $theme;

		$out = '<ul>';
		$out .= '<li><a href=".">Plugin home page</a></li>';
		$out .= '</ul>';

		$theme->assign('sidebar',$out);
	}

	public function get_plugin_path()
	{
		return WEB_URL.PLUGINS_DIR.strtolower($this->plugin_name).'/';
	}
}


?>